<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>04-css的运用.html</title>
    <style>
        /* id 选择器 */
        /*#form-div {*/
        /*    width: 500px;*/
        /*    background-color: lightcyan;*/
        /*    margin: 0 auto;*/
        /*    padding: 30px;*/
        /*}*/
        /*!* 后代 选择器 *!*/
        /*#form-div .ele {*/
        /*    width: 300px;*/
        /*    margin: auto 20px;*/
        /*    text-align: center;*/
        /*}*/

        /* 基于AI 生成的 css 美化效果  */
        #form-div {
            width: 300px;
            margin: 0 auto;
            padding: 20px;
            background-color: #f4f4f4;
        }

        /* Styling form elements */
        .ele {
            margin-bottom: 15px;
        }

        label {
            display: block;
            margin-bottom: 5px;
            font-weight: bold;
        }

        input[type="text"],
        input[type="password"] {
            width: 100%;
            padding: 10px;
            border: 1px solid #ccc;
            border-radius: 5px;
            box-sizing: border-box;
        }

        input[type="submit"] {
            width: 100%;
            padding: 10px;
            border: none;
            border-radius: 5px;
            background-color: #4CAF50;
            color: white;
            cursor: pointer;
            transition: background-color 0.3s;
        }

        input[type="submit"]:hover {
            background-color: #45a049;
        }

    </style>
</head>
<body>
<form action="pages/success.html">
    <div id="form-div">
        <div class="ele">
            <label>用户名称</label>
            <input type="text" name="uname">
        </div>
        <div class="ele">
            <label>用户密码</label>
            <input type="password" name="pwd">
        </div>
        <div class="ele">
            <input type="submit" value="登录">
        </div>
    </div>
</form>
</body>
</html>